import request from '@/utils/request'
export function login(data) {
  return request({
    url: '/sys/login',
    method: 'POST',
    data
  })
}

export function getUserInfo() {
  return request({
    url: '/sys/profile',
    method: 'POST'
  })
}

export function logout() {
  return request()
}

// 根据ID获取角色详情
export function getUserInfoById(id) {
  return request({
    url: '/sys/user/' + id,
    method: 'GET'
  })
}

// 根据ID更新用户数据
export function updateUserInfoById(data) {
  return request({
    url: '/sys/user/' + data.id,
    method: 'PUT',
    data
  })
}
